
import request from '@/utils/request';

export function counselors(){
    return request({
        url: '/system/user/list',
        method: 'get'
    })
}
export function getCounselor(pageNum,pageSize) {
    return request({
        url: `/system/teacher/list?pageNum=${pageNum}&pageSize=${pageSize}`,
        method: 'get'
    })
}

export function checkCounselor() {
    return request({
        url: '/system/user/teacherlist',
        method: 'get'
    })
}

export interface data {
    /*** 头像*/
    avatar: string;
    /*** 性别*/
    gender: string;
    /*** 个人简介*/
    infos: string;
    /*** 标签内容*/
    labels?: string[];
    /*** 办公室地点*/
    location: string;
    /*** 手机号*/
    mobile: string;
    /*** 姓名*/
    name: string;
    /*** 咨询师办公室手机号*/
    phone: string;
    /*** 专业擅长*/
    profession: string;
    /*** 用户id*/
    userId: string;
    [property: string]: any;
}
//添加咨询师
export function add(data: data) {
    return request({
        url: '/system/teacher',
        method: 'post',
        data: data
    })
}

// 获取标签
export function getLabel() {
    return request({
        url: '/system/label/list',
        method: 'get'
    })
}

//搜索咨询师

export function searchCounselor(data) {
    return request({
        url: '/system/teacher/list',
        method: 'get',
        params: data
    })
}

//编辑咨询师
export function editCounselor(data) {
    return request({
        url: '/system/teacher',
        method: 'put',
        data:data
        // params: {
        //     ...data,
        //     labels:[]
        // }
    })
}

// 删除咨询师

export interface ids {
    ids: string;
    [property: string]: any;
}
export function delCounselor(ids: ids) {
    return request({
        url: `/system/teacher/${ids}`,
        method: 'delete'
    })
}
